www.gusucode.com > vc++ 远程控制示例源程序-源码程序 > vc++ 远程控制示例源程序-源码程序\code\PeerYouC\StdAfx.cpp

    //Download by http://www.NewXing.com
// stdafx.cpp : source file that includes just the standard includes
//	PeerYouC.pch will be the pre-compiled header
//	stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"
#include "mainfrm.h"
#include "peermessagelistview.h"
void Message(char *cmd, char *result)
{
	CMainFrame* pMainWnd=(CMainFrame*)AfxGetApp()->GetMainWnd();
	CListCtrl& mess=pMainWnd->m_pListMessage->GetListCtrl();
	int messcount=mess.GetItemCount();
	if(messcount>200)
		mess.DeleteAllItems();
	else
	{
		CString a;
		int insertindex;
		insertindex=mess.InsertItem(0,result);
		mess.SetItem(insertindex,1,LVIF_TEXT,cmd,0,0,0,NULL);
		mess.SetItem(insertindex,2,LVIF_TEXT,ADDRESS,0,0,0,NULL);
		CTime t = CTime::GetCurrentTime();
		a=t.Format("%Y-%m-%d %H:%M:%S");
		mess.SetItem(insertindex,3,LVIF_TEXT,a,0,0,0,NULL);
	}
}